package com.heima.wemedia.feign;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.wemedia.service.WmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: xrl
 * @Date: 2022/10/22  18:17
 * @Version 1.0
 * 自媒体文章审核
 */
@RestController
public class WmNewsCilent {
    @Autowired
    private WmNewsService wmNewsService;

    /**
     * 查询文章列表
     */
    @PostMapping("/api/v1/news/list_vo")
    public ResponseResult news_List(@RequestBody NewsAuthDto dto) {
        return wmNewsService.news_List(dto);
    }

    /**
     * 查询文章详情
     */
    @GetMapping("/api/v1/news/one_vo/{id}")
    public ResponseResult news_ById(@PathVariable("id") Integer id) {
        return wmNewsService.news_ById(id);
    }

    /**
     * 审核失败
     */
    @PostMapping("/api/v1/news/auth_fail")
    public ResponseResult auth_Fail(@RequestBody NewsAuthDto dto) {
        return wmNewsService.auth_Fail(dto);
    }

    /**
     * 审核成功
     */
    @PostMapping("/api/v1/news/auth_pass")
    public ResponseResult auth_Pass(@RequestBody NewsAuthDto dto) {
        return wmNewsService.auth_Pass(dto);
    }
}
